package 多线程02_常见线程方法;

import 多线程01_启动线程.Hero;
import 多线程01_启动线程.KillThread01;

/**
 * @ClassName: TestThreadJoin
 * @Author: AllenSun
 * @Date: 2022/3/18 下午8:37
 */
public class TestThreadPriority {
    public static void main(String[] args) {
        Hero gareen = new Hero("盖伦",616,100);
        Hero teemo = new Hero("提莫",300,130);
        Hero bh = new Hero("赏金猎人",350,165);
        Hero leesin = new Hero("盲僧",455,180);

        KillThread01 killThread01 = new KillThread01(gareen,teemo);
        KillThread01 killThread02 = new KillThread01(bh,leesin);

        // 在线程启动之前设置该线程优先等级，优先级高的线程会有更大的几率获得CPU资源
        killThread01.setPriority(Thread.MAX_PRIORITY);
        killThread02.setPriority(Thread.MIN_PRIORITY);
        killThread01.start();
        killThread02.start();
    }
}
